import React, { createContext, useState } from 'react';

// 创建一个Context
const MyContext = createContext();

// 创建一个ContextProvider组件
const ContextProvider = ({ children }) => {
  const [theme, setTheme] = useState('light');
  const [locale, setLocale] = useState('en');

  return (
    <MyContext.Provider value={{ theme, setTheme, locale, setLocale }}>
      {children}
    </MyContext.Provider>
  );
};

export { MyContext, ContextProvider };
